package com.gpj.sgz.init.base;

import com.gpj.sgz.init.skill.Attack;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @className Genera
 * @description TODO
 * @author GPJ
 * @date 2020/9/27 16:53
 * @version 1.0
 **/
@Setter
@Getter
@NoArgsConstructor
public class General {
    private String id;// 武将ID
    private String name;// 武将名

    private int level;// 等级

    private int exp; // 经验
    private int nextExp; // 下一级经验

    private double force; // 武力
    private double defense; // 防御
    private double intellect; // 智力
    private double speed; // 速度

    private int maxArms;//兵力上线
    private int arms;//实际兵数

    private String armType;//实际兵种
    private double armTypeRate;//兵种加成

    private int forcePoint; // 技能点分配 -- 武力成长
    private int defensePoint; // 技能点分配 -- 防御成长
    private int intellectPoint; // 技能点分配 -- 智力成长
    private int speedPoint; // 技能点分配 -- 速度成长

    private int skillPoint; // 待分配技能点

    private String weapon; // 武器
    private String armour; // 防具
    private String horse; // 马

    private GeneralEnum type; // 武将类型

    private List<Skill> skills = new ArrayList<>();

    public General(GeneralEnum type) {
        this.name = type.getName();
        this.level = 1;
        this.exp = 0;
        this.nextExp = 1000;
        this.force = type.getInitForce();
        this.defense = type.getInitDefense();
        this.intellect = type.getIntiIntellect();
        this.speed = type.getIntiSpeed();
        this.maxArms = 1000;
        this.arms = 0;
        this.armType = null;
        this.armTypeRate = 0;
        this.forcePoint = 0;
        this.defensePoint = 0;
        this.intellectPoint = 0;
        this.speedPoint = 0;
        this.skillPoint = 0;
        this.weapon = null;
        this.armour = null;
        this.horse = null;
        this.type = type;
        this.skills.add(new Attack());
    }
}
